<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% String path = request.getContextPath(); %>
<html>
<head>
    <title>访问信息表</title>
</head>
<body>

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="page-container">
    <link href="http://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css" rel="stylesheet" />
    <script src="${pageContext.request.contextPath}/jQuery/jquery-3.6.0.js"></script>
    <script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js" ></script>

    <table class="table" id="mtable">
        <thead>
        <tr>
            <th>姓名</th>
            <th>性别</th>
            <th>电话</th>
            <th>到访寝室</th>
            <th>事由</th>
            <th>到访时间</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${visits}" var="one">
            <tr align="center">
                <td>${one.v_name}</td>
                <td>${one.v_sex}</td>
                <td>${one.v_tel}</td>
                <td>${one.v_ToRoom}</td>
                <td>${one.v_thing}</td>
                <td>${one.v_time}</td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/hui/lib/datatables/1.10.15/jquery.dataTables.js">
<script type="text/javascript" charset="utf8" src="${pageContext.request.contextPath}/hui/lib/datatables/1.10.15/jquery.dataTables.min.js"></script>

<script>
    $(function () {
        $('#mtable').DataTable({
            "order": [[ 5,"asc" ]]
        });
    })
</script>
</body>
</html>
